# -*- coding: utf-8 -*-
import os


def CompressImage(image_name):
	os.system("convert -resize\"600x800>\" %s %s" % (image_name, image_name))


def CompressAll():
	ext_names = ['.JPG', '.jpg', '.jepg']
	for each_image in os.listdir('./'):
		for ext_name in ext_names:
			if each_image.endswith(ext_name):
				CompressImage(each_image)
				break


def run_to_pdf():
	CompressAll()
	os.system("convert *.JPG book.pdf")
